﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Automobile.service.Model;
using Automobile.service.DAL;
using System.Data;

namespace Automobile.service.BLL
{
    public class EmployeeBLL
    {
        EmployeeDAL dal = new EmployeeDAL();
        /// <summary>
        /// 员工管理——添加
        /// </summary>
        /// <param name="emp"></param>
        /// <returns></returns>
        public int AddEmployee(Employee emp)
        {
            return dal.AddEmployee(emp);
        }
        /// <summary>
        /// 员工管理——分页显示
        /// </summary>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public List<Employee> ShowlistEmployee(int PageIndex, int PageSize)
        {
            return dal.ShowlistEmployee(PageIndex,PageSize);
        }
        /// <summary>
        /// 员工管理——启用
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Updempstatetrue(int id)
        {
            return dal.Updempstatetrue(id);
        }
        /// <summary>
        /// 员工管理——停用
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int Updempstatefalse(int id)
        {
            return dal.Updempstatefalse(id);
        }
        /// <summary>
        /// 员工管理——获取要修改的数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable GetEmployeeByempid(int id)
        {
            return dal.GetEmployeeByempid(id);
        }
        /// <summary>
        /// 员工管理——修改员工信息
        /// </summary>
        /// <param name="emp"></param>
        /// <returns></returns>
        public int UpdEmployeeByempid(Employee emp)
        {
            return dal.UpdEmployeeByempid(emp);
        }
        /// <summary>
        /// 登陆
        /// </summary>
        /// <param name="empname"></param>
        /// <param name="emppwd"></param>
        /// <returns></returns>
        public string Landing(string empname, string emppwd)
        {
            return dal.Landing(empname,emppwd);
        }
        /// <summary>
        /// 获取登陆人的编号
        /// </summary>
        /// <param name="empname"></param>
        /// <param name="emppwd"></param>
        /// <returns></returns>
        public int GetEmpidByLanding(string empname, string emppwd)
        {
            return dal.GetEmpidByLanding(empname,emppwd);
        }
        /// <summary>
        /// 员工管理——总记录数
        /// </summary>
        /// <returns></returns>
        public int EmpCount()
        {
            return dal.EmpCount();
        }
        /// <summary>
        /// 员工管理——根据编号获取状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int GetEmpStateById(int id)
        {
            return dal.GetEmpStateById(id);
        }
        /// <summary>
        /// 员工管理——根据用户名查询
        /// </summary>
        /// <param name="empname"></param>
        /// <returns></returns>
        public DataTable GetEmpByEmpName(string empname, int pageIndex, int pagesize)
        {
            return dal.GetEmpByEmpName(empname, pageIndex, pagesize);
        }
    }
}
